<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::RequestSet - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="TSort.html">Gem::TSort</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-gem">#gem</a>
    <li ><a href="#method-i-import">#import</a>
    <li ><a href="#method-i-install">#install</a>
    <li ><a href="#method-i-install_from_gemdeps">#install_from_gemdeps</a>
    <li ><a href="#method-i-install_hooks">#install_hooks</a>
    <li ><a href="#method-i-install_into">#install_into</a>
    <li ><a href="#method-i-load_gemdeps">#load_gemdeps</a>
    <li ><a href="#method-i-resolve">#resolve</a>
    <li ><a href="#method-i-resolve_current">#resolve_current</a>
    <li ><a href="#method-i-sorted_requests">#sorted_requests</a>
    <li ><a href="#method-i-specs">#specs</a>
    <li ><a href="#method-i-specs_in">#specs_in</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::RequestSet">
    <h1 id="class-Gem::RequestSet" class="class">
      class Gem::RequestSet
    </h1>

    <section class="description">
    
<p>A <a href="RequestSet.html"><code>RequestSet</code></a> groups a request to activate a set of dependencies.</p>

<pre class="ruby"><span class="ruby-identifier">nokogiri</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-string">&#39;nokogiri&#39;</span>, <span class="ruby-string">&#39;~&gt; 1.6&#39;</span>
<span class="ruby-identifier">pg</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-string">&#39;pg&#39;</span>, <span class="ruby-string">&#39;~&gt; 0.14&#39;</span>

<span class="ruby-identifier">set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestSet</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">nokogiri</span>, <span class="ruby-identifier">pg</span>

<span class="ruby-identifier">requests</span> = <span class="ruby-identifier">set</span>.<span class="ruby-identifier">resolve</span>

<span class="ruby-identifier">p</span> <span class="ruby-identifier">requests</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">full_name</span> }
<span class="ruby-comment">#=&gt; [&quot;nokogiri-1.6.0&quot;, &quot;mini_portile-0.5.1&quot;, &quot;pg-0.17.0&quot;]</span>
</pre>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-always_install" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">always_install</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Array of gems to install even if already installed</p>
              </div>
            </div>
          <div id="attribute-i-dependencies" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">dependencies</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-development" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">development</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-development_shallow" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">development_shallow</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Set to true if you want to install only direct development dependencies.</p>
              </div>
            </div>
          <div id="attribute-i-errors" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">errors</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Errors fetching gems during resolution.</p>
              </div>
            </div>
          <div id="attribute-i-ignore_dependencies" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_dependencies</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>When true, dependency resolution is not performed, only the requested gems are installed.</p>
              </div>
            </div>
          <div id="attribute-i-prerelease" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">prerelease</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>If true, allow dependencies to match prerelease gems.</p>
              </div>
            </div>
          <div id="attribute-i-remote" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">remote</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>When false no remote sets are used for resolving gems.</p>
              </div>
            </div>
          <div id="attribute-i-soft_missing" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">soft_missing</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Treat missing dependencies as silent errors</p>
              </div>
            </div>
          <div id="attribute-i-source_set" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">source_set</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The set of source gems imported via load_gemdeps.</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(*deps) { |self| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a <a href="RequestSet.html"><code>RequestSet</code></a> for a list of <a href="Dependency.html"><code>Gem::Dependency</code></a> objects, <code>deps</code>.  You can then <a href="RequestSet.html#method-i-resolve"><code>resolve</code></a> and <a href="RequestSet.html#method-i-install"><code>install</code></a> the resolved list of dependencies.</p>

<pre class="ruby"><span class="ruby-identifier">nokogiri</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-string">&#39;nokogiri&#39;</span>, <span class="ruby-string">&#39;~&gt; 1.6&#39;</span>
<span class="ruby-identifier">pg</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-string">&#39;pg&#39;</span>, <span class="ruby-string">&#39;~&gt; 0.14&#39;</span>

<span class="ruby-identifier">set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestSet</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">nokogiri</span>, <span class="ruby-identifier">pg</span>
</pre>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 94</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">deps</span>)
  <span class="ruby-ivar">@dependencies</span> = <span class="ruby-identifier">deps</span>

  <span class="ruby-ivar">@always_install</span>      = []
  <span class="ruby-ivar">@conservative</span>        = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@dependency_names</span>    = {}
  <span class="ruby-ivar">@development</span>         = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@development_shallow</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@errors</span>              = []
  <span class="ruby-ivar">@git_set</span>             = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ignore_dependencies</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@install_dir</span>         = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">dir</span>
  <span class="ruby-ivar">@prerelease</span>          = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@remote</span>              = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@requests</span>            = []
  <span class="ruby-ivar">@sets</span>                = []
  <span class="ruby-ivar">@soft_missing</span>        = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@sorted_requests</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@specs</span>               = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@vendor_set</span>          = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@source_set</span>          = <span class="ruby-keyword">nil</span>

  <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-gem" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem</span><span
                                class="method-args">(name, *reqs)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare that a gem of name <code>name</code> with <code>reqs</code> requirements is needed.</p>

                              <div class="method-source-code" id="gem-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 122</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">reqs</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span> = <span class="ruby-ivar">@dependency_names</span>[<span class="ruby-identifier">name</span>]
    <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">reqs</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">dep</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">reqs</span>
    <span class="ruby-ivar">@dependency_names</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">dep</span>
    <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">dep</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-import" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">import</span><span
                                class="method-args">(deps)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add <code>deps</code> <a href="Dependency.html"><code>Gem::Dependency</code></a> objects to the set.</p>

                              <div class="method-source-code" id="import-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 135</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">import</span>(<span class="ruby-identifier">deps</span>)
  <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">concat</span> <span class="ruby-identifier">deps</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">(options) { |request, installer| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Installs gems for this <a href="RequestSet.html"><code>RequestSet</code></a> using the <a href="Installer.html"><code>Gem::Installer</code></a> <code>options</code>.</p>

<p>If a <code>block</code> is given an activation <code>request</code> and <code>installer</code> are yielded. The <code>installer</code> will be <code>nil</code> if a gem matching the request was already installed.</p>

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 146</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>(<span class="ruby-identifier">options</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :yields: request, installer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:install_dir</span>]
    <span class="ruby-identifier">requests</span> = <span class="ruby-identifier">install_into</span> <span class="ruby-identifier">dir</span>, <span class="ruby-keyword">false</span>, <span class="ruby-identifier">options</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">requests</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@prerelease</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]

  <span class="ruby-identifier">requests</span> = []
  <span class="ruby-identifier">download_queue</span> = <span class="ruby-constant">Thread</span><span class="ruby-operator">::</span><span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-comment"># Create a thread-safe list of gems to download</span>
  <span class="ruby-identifier">sorted_requests</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">download_queue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">req</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Create N threads in a pool, have them download all the gems</span>
  <span class="ruby-identifier">threads</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">concurrent_downloads</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-comment"># When a thread pops this item, it knows to stop running. The symbol</span>
    <span class="ruby-comment"># is queued here so that there will be one symbol per thread.</span>
    <span class="ruby-identifier">download_queue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">:stop</span>

    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span>
      <span class="ruby-comment"># The pop method will block waiting for items, so the only way</span>
      <span class="ruby-comment"># to stop a thread from running is to provide a final item that</span>
      <span class="ruby-comment"># means the thread should stop.</span>
      <span class="ruby-keyword">while</span> <span class="ruby-identifier">req</span> = <span class="ruby-identifier">download_queue</span>.<span class="ruby-identifier">pop</span>
        <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">req</span> <span class="ruby-operator">==</span> <span class="ruby-value">:stop</span>
        <span class="ruby-identifier">req</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">download</span> <span class="ruby-identifier">options</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">installed?</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Wait for all the downloads to finish before continuing</span>
  <span class="ruby-identifier">threads</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:value</span>)

  <span class="ruby-comment"># Install requested gems after they have been downloaded</span>
  <span class="ruby-identifier">sorted_requests</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">installed?</span>
      <span class="ruby-identifier">req</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">build_extensions</span>

      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@always_install</span>.<span class="ruby-identifier">none?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span> <span class="ruby-identifier">spec</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">spec</span> }
        <span class="ruby-keyword">yield</span> <span class="ruby-identifier">req</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-keyword">next</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">spec</span> =
      <span class="ruby-keyword">begin</span>
        <span class="ruby-identifier">req</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">install</span> <span class="ruby-identifier">options</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">installer</span><span class="ruby-operator">|</span>
          <span class="ruby-keyword">yield</span> <span class="ruby-identifier">req</span>, <span class="ruby-identifier">installer</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RuntimeRequirementNotMetError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
        <span class="ruby-identifier">suggestion</span> = <span class="ruby-node">&quot;There are no versions of #{req.request} compatible with your Ruby &amp; RubyGems&quot;</span>
        <span class="ruby-identifier">suggestion</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;. Maybe try installing an older version of the gem you&#39;re looking for?&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@always_install</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">req</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">spec</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">suggestion</span> = <span class="ruby-identifier">suggestion</span>
        <span class="ruby-identifier">raise</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">requests</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">requests</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:gemdeps</span>]

  <span class="ruby-identifier">install_hooks</span> <span class="ruby-identifier">requests</span>, <span class="ruby-identifier">options</span>

  <span class="ruby-identifier">requests</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_from_gemdeps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_from_gemdeps</span><span
                                class="method-args">(options, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Installs from the gem dependencies files in the <code>:gemdeps</code> option in <code>options</code>, yielding to the <code>block</code> as in <a href="RequestSet.html#method-i-install"><code>install</code></a>.</p>

<p>If <code>:without_groups</code> is given in the <code>options</code>, those groups in the gem dependencies file are not used.  See <a href="Installer.html"><code>Gem::Installer</code></a> for other <code>options</code>.</p>

                              <div class="method-source-code" id="install_from_gemdeps-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 222</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_from_gemdeps</span>(<span class="ruby-identifier">options</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">gemdeps</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:gemdeps</span>]

  <span class="ruby-ivar">@install_dir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:install_dir</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">dir</span>
  <span class="ruby-ivar">@prerelease</span>  = <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]
  <span class="ruby-ivar">@remote</span>      = <span class="ruby-identifier">options</span>[<span class="ruby-value">:domain</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">:local</span>
  <span class="ruby-ivar">@conservative</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:conservative</span>]

  <span class="ruby-identifier">gem_deps_api</span> = <span class="ruby-identifier">load_gemdeps</span> <span class="ruby-identifier">gemdeps</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:without_groups</span>], <span class="ruby-keyword">true</span>

  <span class="ruby-identifier">resolve</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:explain</span>]
    <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Gems to install:&quot;</span>

    <span class="ruby-identifier">sorted_requests</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;  #{spec.full_name}&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">really_verbose</span>
      <span class="ruby-ivar">@resolver</span>.<span class="ruby-identifier">stats</span>.<span class="ruby-identifier">display</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">installed</span> = <span class="ruby-identifier">install</span> <span class="ruby-identifier">options</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-value">:lock</span>, <span class="ruby-keyword">true</span>
      <span class="ruby-identifier">lockfile</span> =
        <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestSet</span><span class="ruby-operator">::</span><span class="ruby-constant">Lockfile</span>.<span class="ruby-identifier">build</span> <span class="ruby-keyword">self</span>, <span class="ruby-identifier">gemdeps</span>, <span class="ruby-identifier">gem_deps_api</span>.<span class="ruby-identifier">dependencies</span>
      <span class="ruby-identifier">lockfile</span>.<span class="ruby-identifier">write</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">installed</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_hooks" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_hooks</span><span
                                class="method-args">(requests, options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Call hooks on installed gems</p>

                              <div class="method-source-code" id="install_hooks-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 298</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_hooks</span>(<span class="ruby-identifier">requests</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">specs</span> = <span class="ruby-identifier">requests</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">request</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">request</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">ActivationRequest</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">request</span>.<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">spec</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">request</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;dependency_installer&quot;</span>
  <span class="ruby-identifier">inst</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">DependencyInstaller</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">options</span>
  <span class="ruby-identifier">inst</span>.<span class="ruby-identifier">installed_gems</span>.<span class="ruby-identifier">replace</span> <span class="ruby-identifier">specs</span>

  <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">done_installing_hooks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hook</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">hook</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">inst</span>, <span class="ruby-identifier">specs</span>
  <span class="ruby-keyword">end</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">done_installing_hooks</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_into" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_into</span><span
                                class="method-args">(dir, force = true, options = {}) { |request, nil| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_into-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 257</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_into</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">force</span> = <span class="ruby-keyword">true</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">gem_home</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;GEM_HOME&quot;</span>]
  <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;GEM_HOME&quot;</span>] = <span class="ruby-identifier">dir</span>

  <span class="ruby-identifier">existing</span> = <span class="ruby-identifier">force</span> <span class="ruby-operator">?</span> [] <span class="ruby-operator">:</span> <span class="ruby-identifier">specs_in</span>(<span class="ruby-identifier">dir</span>)
  <span class="ruby-identifier">existing</span>.<span class="ruby-identifier">delete_if</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@always_install</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">s</span> }

  <span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-identifier">dir</span>

  <span class="ruby-identifier">installed</span> = []

  <span class="ruby-identifier">options</span>[<span class="ruby-value">:development</span>] = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:install_dir</span>] = <span class="ruby-identifier">dir</span>
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:only_install_dir</span>] = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@prerelease</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:prerelease</span>]

  <span class="ruby-identifier">sorted_requests</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">request</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">spec</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">spec</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">existing</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">full_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">full_name</span> }
      <span class="ruby-keyword">yield</span> <span class="ruby-identifier">request</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">install</span> <span class="ruby-identifier">options</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">installer</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">yield</span> <span class="ruby-identifier">request</span>, <span class="ruby-identifier">installer</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">installed</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">request</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">install_hooks</span> <span class="ruby-identifier">installed</span>, <span class="ruby-identifier">options</span>

  <span class="ruby-identifier">installed</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;GEM_HOME&quot;</span>] = <span class="ruby-identifier">gem_home</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_gemdeps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_gemdeps</span><span
                                class="method-args">(path, without_groups = [], installing = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Load a dependency management file.</p>

                              <div class="method-source-code" id="load_gemdeps-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 320</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_gemdeps</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">without_groups</span> = [], <span class="ruby-identifier">installing</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-ivar">@git_set</span>    = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">GitSet</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@vendor_set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">VendorSet</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@source_set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">SourceSet</span>.<span class="ruby-identifier">new</span>

  <span class="ruby-ivar">@git_set</span>.<span class="ruby-identifier">root_dir</span> = <span class="ruby-ivar">@install_dir</span>

  <span class="ruby-identifier">lock_file</span> = <span class="ruby-node">&quot;#{File.expand_path(path)}.lock&quot;</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">tap</span>(<span class="ruby-operator">&amp;</span><span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">UNTAINT</span>)
  <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">tokenizer</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestSet</span><span class="ruby-operator">::</span><span class="ruby-constant">Lockfile</span><span class="ruby-operator">::</span><span class="ruby-constant">Tokenizer</span>.<span class="ruby-identifier">from_file</span> <span class="ruby-identifier">lock_file</span>
    <span class="ruby-identifier">parser</span> = <span class="ruby-identifier">tokenizer</span>.<span class="ruby-identifier">make_parser</span> <span class="ruby-keyword">self</span>, []
    <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">gf</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">RequestSet</span><span class="ruby-operator">::</span><span class="ruby-constant">GemDependencyAPI</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>, <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">gf</span>.<span class="ruby-identifier">installing</span> = <span class="ruby-identifier">installing</span>
  <span class="ruby-identifier">gf</span>.<span class="ruby-identifier">without_groups</span> = <span class="ruby-identifier">without_groups</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">without_groups</span>
  <span class="ruby-identifier">gf</span>.<span class="ruby-identifier">load</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve</span><span
                                class="method-args">(set = Gem::Resolver::BestSet.new)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resolve the requested dependencies and return an Array of Specification objects to be activated.</p>

                              <div class="method-source-code" id="resolve-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 387</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve</span>(<span class="ruby-identifier">set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">BestSet</span>.<span class="ruby-identifier">new</span>)
  <span class="ruby-ivar">@sets</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">set</span>
  <span class="ruby-ivar">@sets</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@git_set</span>
  <span class="ruby-ivar">@sets</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@vendor_set</span>
  <span class="ruby-ivar">@sets</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@source_set</span>

  <span class="ruby-identifier">set</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span>.<span class="ruby-identifier">compose_sets</span>(<span class="ruby-operator">*</span><span class="ruby-ivar">@sets</span>)
  <span class="ruby-identifier">set</span>.<span class="ruby-identifier">remote</span> = <span class="ruby-ivar">@remote</span>
  <span class="ruby-identifier">set</span>.<span class="ruby-identifier">prerelease</span> = <span class="ruby-ivar">@prerelease</span>

  <span class="ruby-identifier">resolver</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span>.<span class="ruby-identifier">new</span> <span class="ruby-ivar">@dependencies</span>, <span class="ruby-identifier">set</span>
  <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">development</span>         = <span class="ruby-ivar">@development</span>
  <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">development_shallow</span> = <span class="ruby-ivar">@development_shallow</span>
  <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">ignore_dependencies</span> = <span class="ruby-ivar">@ignore_dependencies</span>
  <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">soft_missing</span>        = <span class="ruby-ivar">@soft_missing</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@conservative</span>
    <span class="ruby-identifier">installed_gems</span> = {}
    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
      (<span class="ruby-identifier">installed_gems</span>[<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>] <span class="ruby-operator">||=</span> []) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">spec</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">skip_gems</span> = <span class="ruby-identifier">installed_gems</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@resolver</span> = <span class="ruby-identifier">resolver</span>

  <span class="ruby-ivar">@requests</span> = <span class="ruby-identifier">resolver</span>.<span class="ruby-identifier">resolve</span>

  <span class="ruby-ivar">@errors</span> = <span class="ruby-identifier">set</span>.<span class="ruby-identifier">errors</span>

  <span class="ruby-ivar">@requests</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_current" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_current</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resolve the requested dependencies against the gems available via <a href="../Gem.html#method-c-path"><code>Gem.path</code></a> and return an Array of Specification objects to be activated.</p>

                              <div class="method-source-code" id="resolve_current-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 424</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_current</span>
  <span class="ruby-identifier">resolve</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Resolver</span><span class="ruby-operator">::</span><span class="ruby-constant">CurrentSet</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sorted_requests" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sorted_requests</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sorted_requests-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 428</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sorted_requests</span>
  <span class="ruby-ivar">@sorted_requests</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">strongly_connected_components</span>.<span class="ruby-identifier">flatten</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 432</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs</span>
  <span class="ruby-ivar">@specs</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@requests</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:full_spec</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-specs_in" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">specs_in</span><span
                                class="method-args">(dir)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="specs_in-source">
            <pre><span class="ruby-comment"># File rubygems/request_set.rb, line 436</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">specs_in</span>(<span class="ruby-identifier">dir</span>)
  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">glob_files_in_dir</span>(<span class="ruby-string">&quot;*.gemspec&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-string">&quot;specifications&quot;</span>)).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">load</span> <span class="ruby-identifier">g</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

